﻿using System;

namespace RexToy.UI
{
    public class DomEvent
    {
        public static implicit operator DomEvent(string val)
        {
            return new DomEvent();
        }

        private DomEvent() { }

        /// <summary>
        /// An element loses focus
        /// </summary>
        [EvalAtCompile]
        public const string OnBlur = "onblur";


        /// <summary>
        /// The content of a field changes
        /// </summary>
        [EvalAtCompile]
        public const string OnChange = "onchange";


        /// <summary>
        /// Mouse clicks an object
        /// </summary>
        [EvalAtCompile]
        public const string OnClick = "onclick";


        /// <summary>
        /// Mouse double-clicks an object
        /// </summary>
        [EvalAtCompile]
        public const string OnDoubleClick = "ondblclick";


        /// <summary>
        /// An error occurs when loading a document or an image
        /// </summary>
        [EvalAtCompile]
        public const string OnError = "onerror";


        /// <summary>
        /// An element gets focus
        /// </summary>
        [EvalAtCompile]
        public const string OnFocus = "onfocus";


        /// <summary>
        /// A keyboard key is pressed
        /// </summary>
        [EvalAtCompile]
        public const string OnKeyDown = "onkeydown";


        /// <summary>
        /// A keyboard key is pressed or held down
        /// </summary>
        [EvalAtCompile]
        public const string OnKeyPress = "onkeypress";


        /// <summary>
        /// A keyboard key is released
        /// </summary>
        [EvalAtCompile]
        public const string OnKeyUp = "onkeyup";


        /// <summary>
        /// A page or image is finished loading
        /// </summary>
        [EvalAtCompile]
        public const string OnLoad = "onload";


        /// <summary>
        /// A mouse button is pressed
        /// </summary>
        [EvalAtCompile]
        public const string OnMouseDown = "onmousedown";


        /// <summary>
        /// The mouse is moved
        /// </summary>
        [EvalAtCompile]
        public const string OnMouseMove = "onmousemove";


        /// <summary>
        /// The mouse is moved off an element
        /// </summary>
        [EvalAtCompile]
        public const string OnMouseOut = "onmouseout";


        /// <summary>
        /// The mouse is moved over an element
        /// </summary>
        [EvalAtCompile]
        public const string OnMouseOver = "onmouseover";


        /// <summary>
        /// A mouse button is released
        /// </summary>
        [EvalAtCompile]
        public const string OnMouseUp = "onmouseup";


        /// <summary>
        /// A window or frame is resized
        /// </summary>
        [EvalAtCompile]
        public const string OnResize = "onresize";


        /// <summary>
        /// Text is selected
        /// </summary>
        [EvalAtCompile]
        public const string OnSelect = "onselect";


        /// <summary>
        /// The user exits the page
        /// </summary>
        [EvalAtCompile]
        public const string OnUnload = "onunload";
    }
}
